package com.newcoin.chat.beans;

import com.newcoin.chat.beans.vo.UserVo;

import java.text.Collator;
import java.util.Comparator;
import java.util.Locale;

public class ComparatorUser implements Comparator<UserVo> {

    @Override
    public int compare(UserVo o1, UserVo o2) {
        //获取中文环境
        Comparator component = Collator.getInstance(Locale.CHINA);
        return component.compare(o1.getNickname(), o2.getNickname());
    }
}
